<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>浮动-清除浮动</title>
  <style>
    .top {
      margin: 10px auto;
      width: 1200px;
      /* 若没有高度,页面布局错乱 */
      height: 300px;
      background-color: pink;
    }
    .buttom {
      height: 100px;
      background-color: brown;
    }
    .left {
      float: left;
      width: 200px;
      height: 300px;
      background-color: skyblue;
    }
    .right {
      float: right;
      width: 950px;
      height: 300px;
      background-color: orange;
    }
  </style>
</head>
<body>
  <!-- 
    场景: 浮动元素会脱标,如果父级没有高度,子级无法撑开父级高度(可能导致页面布局错乱)
    解决方法: 请求浮动(清除浮动带来的影响)
   -->
  <div class="top">
    <div class="left"></div>
    <div class="right"></div>
  </div>
  <div class="buttom"></div>
</body>
</html>